new Vue({
	el: '#app',
	data() {
		return {
			tableData: [{
				projectId: '1',
				projectCompany: 'sun',
				projectPrice: '200',
				startTime: '2016-05-02',
				endTime: '2016-05-02',
				updateTime: '2016-05-02',
				projectName: '王小虎',
				statusId: '1',
			}],
			dynamicTags: ['标签一', '标签二', '标签三'],
			inputVisible: false,
			inputValue: '',
			percentage: 80,
			search: ''
		}
	},
	created() {
		this.projectAjax();
	},
	methods: {
				projectAjax: function() {
					var self = this;
					var xml = window.XMLHttpRequest ? new XMLHttpRequest() : ActiveXObject("microsoft.XMLHttp");
					xml.open("get", "http://www.oa.com/project/selectAll", true);
					xml.send();
					xml.onreadystatechange = function() {
						if (xml.readyState == 4 && xml.status == 200) {
							var x = xml.responseText;
							self.tableData = JSON.parse(x);
							console.log(x)
						}
					};
				},
		handleEdit(index, row) {
			var str=window.location.href
			str="project_edit.html?projectId="+row.projectId+"&projectName="+row.projectName+"&projectCompany="+row.projectCompany
				+"&projectPrice="+row.projectPrice+"&startTime="+row.startTime+"&endTime="+row.endTime
				+"&updateTime="+row.updateTime+"&statusId="+row.statusId+"&projectOrder="+1;
			location=str;
		},
		handleDelete(index, row) {
			var xml = window.XMLHttpRequest ? new XMLHttpRequest() : ActiveXObject("microsoft.XMLHttp");
			xml.open("get", "http://www.oa.com/project/delete", true);
			xml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xml.send("projectId="+row.projectId);
			xml.onreadystatechange = function() {
				if (xml.readyState == 4 && xml.status == 200) {
					var x = xml.responseText;
					self.tableData = JSON.parse(x);
				}
			};
		}

	}

})
